CXX = g++
CXXFLAGS = -std=c++14 -O2 -Wall -I../include -I../../include -I/home/heppen/libkperf/output/include
LDFLAGS = -L/home/heppen/libkperf/output/lib -lkperf -lsym -lpthread
SRCDIR = src
INCDIR = include
OBJDIR = build
TARGET = thread_binding

SOURCES = $(wildcard $(SRCDIR)/*.cpp)
OBJECTS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SOURCES))

all: $(TARGET)

$(OBJDIR)/%.o: $(SRCDIR)/%.cpp | $(OBJDIR)
	$(CXX) $(CXXFLAGS) -c $< -o $@

$(OBJDIR):
	mkdir -p $(OBJDIR)

$(TARGET): $(OBJECTS)
	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)

clean:
	rm -rf $(OBJDIR) $(TARGET)

.PHONY: all clean 